package demoMod.stsconsole.cards.red;

import demoMod.stsconsole.cards.AbstractCard;
import demoMod.stsconsole.characters.AbstractPlayer;
import demoMod.stsconsole.core.AbstractCreature;
import demoMod.stsconsole.powers.StrengthPower;

public class Disarm extends AbstractCard {
    public static final String ID = "Disarm";

    public Disarm() {
        super(ID);
        this.color = CardColor.RED;
        this.cost = 1;
        this.rarity = CardRarity.UNCOMMON;
        this.type = CardType.SKILL;
        this.target = CardTarget.ENEMY;
        this.exhaust = true;
        this.magicNumber = 2;
    }

    @Override
    public void upgrade() {
        if (!this.upgraded) {
            this.upgraded = true;
            this.name = this.name + "+";
            this.upgradeTimes++;
            this.magicNumber++;
        }
    }

    @Override
    public boolean use(AbstractPlayer p, AbstractCreature target) {
        if (target != null) {
            target.applyPower(p, new StrengthPower(target, -this.magicNumber));
        }
        return true;
    }
}
